package com.huluobo.h3kotlinproject.db

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.huluobo.h3kotlinproject.db.entity.Money

/**
 *  Created by LC on 2023/10/20.
 *  账号余额的增删改查
 */
@Dao
interface MoneyDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertMoney(money: Money)

    @Update
    fun updateMoney(money: Money)

    @Query("select * from user_money where user_id = :userId")
    fun queryUserMoney(userId: Int): Money

    @Delete
    fun deleteUserMoney(money: Money)
}